import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import '@/style/index.scss'

import Index from '@/mixin'
Vue.mixin(Index)

Vue.config.productionTip = false

Vue.directive('permission', {
  // 当被绑定的元素插入到 DOM 中时……
  inserted: function (el, { value }) {
    // 聚焦元素
    console.log(value, 'permission')
    const Permissions = store.state.Permissions
    console.log(Permissions, 'Permissions')
    if (!Permissions?.includes(value)) {
      el.style.display = 'none'
    } else {
      el.style.display = 'block'
    }
  }
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
